<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">
  <head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2014. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="Content-Style-Type" content="text/css">

    <title>Java Search Tab</title>
    <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
  </head>

  <body>
    <h1>Java Search Tab</h1>

    <p>This tab in the Search dialog allows you to search for Java elements. To show the tab invoke <b>Search &gt; Java</b>.</p>

    <h2>Search string</h2>

    <p>In this field, type the expression for which you wish to search, using the wildcard characters mentioned in the dialog as needed. This field is initialized based on the
    current selection.</p>
<!-- Description copied from Javadoc of org.eclipse.jdt.core.search.SearchPattern.createPattern(String, int, int, int): -->
 <ul>
 	<li>Type patterns have the following syntax:
 		<p><b><code>[qualification '.']typeName ['&lt;' typeArguments '&gt;']</code></b></p>
			<p>Examples:</p>
			<ul>
 			<li><code>java.lang.Object</code></li>
				<li><code>Runnable</code></li>
				<li><code>List&lt;String&gt;</code></li>
			</ul>
			<p>
			Type arguments can be specified to search for references to parameterized types
 		using following syntax:</p><p>
 		<b><code>'&lt;' { [ '?' {'extends'|'super'} ] type ( ',' [ '?' {'extends'|'super'} ] type )* | '?' } '&gt;'</code></b>
 		</p><div style="font-style:italic;">
 		Note that:
 		<ul>
 			<li>'*' is not valid inside type arguments definition &lt;&gt;</li>
 			<li>'?' is treated as a wildcard when it is inside &lt;&gt; (i.e. it must be put on first position of the type argument)</li>
 		</ul>
 		</div>
 		<br>
 	</li>
 	<li>Method patterns have the following syntax:
 		<p><b><code>[declaringType '.'] ['&lt;' typeArguments '&gt;'] methodName ['(' parameterTypes ')'] [returnType]</code></b></p>
			<p>Type arguments have the same syntax as explained in the type patterns section.</p>
			<p>Examples:</p>
			<ul>
				<li><code>java.lang.Runnable.run() void</code></li>
				<li><code>main(*)</code></li>
				<li><code>&lt;String&gt;toArray(String[])</code></li>
			</ul>
 		<br>
		</li>
 	<li>Constructor patterns have the following syntax:
			<p><b><code>['&lt;' typeArguments '&gt;'] [declaringQualification '.'] typeName ['(' parameterTypes ')']</code></b></p>
			<p>Type arguments have the same syntax as explained in the type patterns section.</p>
			<p><i>Note that the constructor name should not be entered as it is always the same as the type name.</i></p>
			<p>Examples:</p>
			<ul>
				<li><code>java.lang.Object()</code></li>
				<li><code>Test(*)</code></li>
				<li><code>&lt;Exception&gt;Sample(Exception)</code></li>
			</ul>
 		<br>
 	</li>
 	<li>Field patterns have the following syntax:
			<p><b><code>[declaringType '.'] fieldName [fieldType]</code></b></p>
			<p>Examples:</p>
			<ul>
				<li><code>java.lang.String.serialVersionUID long</code></li>
				<li><code>field*</code></li>
			</ul>
 		<br>
 	</li>
 	<li>Package patterns have the following syntax:
			<p><b><code>packageNameSegment {'.' packageNameSegment}</code></b></p>
			<p>Examples:</p>
			<ul>
				<li><code>java.lang</code></li>
				<li><code>org.e*.jdt.c*e</code></li>
			</ul>
 	</li>
 </ul>
<!-- End of copy -->

    <h2 class="Head">Search For</h2>

    <p>Select to search for one of the following kinds of elements:</p>

    <ul>
      <li>Type</li>

      <li>Method</li>

      <li>Package</li>

      <li>Constructor</li>

      <li>Module</li>

      <li>Field</li>
    </ul>

    <h2 class="Head">Limit To</h2>

    <p>Select to limit your search results to one of the following kinds of matches:</p>

    <ul>
      <li>Declarations</li>

      <li>Implementors (available only when searching for types)</li>

      <li>References</li>

      <li>All occurrences</li>

      <li>Read access (available only when searching for fields)</li>

      <li>Write access (available only when searching for fields)</li>
      
      <li>Match locations (available only when searching for types or methods references).
        <p>Match locations allow to further narrow the location of matches.</p>
        <p>Select the location where to search for:</p>
        <ul>
          <li>type reference:
            <ul>
              <li>Super class declarations</li>
              <li>Annotations</li>
              <li>Field types</li>
              <li>Local variable types</li>
              <li>Method return types</li>
              <li>Method parameter types</li>
              <li>Thrown exception types</li>
              <li>Type parameter bounds</li>
              <li>Wildcard bounds</li>
              <li>Type argument</li>
              <li>Cast expressions</li>
              <li>Catch clauses</li>
              <li>Class instance creations</li>
              <li>'instanceof' checks</li>
            </ul>
          </li>
          <li>method reference:
            <ul>
              <li>'this.' references</li>
              <li>Implicit 'this.' references</li>
              <li>'super.' references</li>
              <li>Qualified references</li>
              <li>'::' method references</li>
            </ul>
          </li>
        </ul>
      </li>
    </ul>

    <h2 class="Item">Search In</h2>
   
	<p>Select where in the scope to search for results</p>
	
	<ul>
		<li>Sources: Search in all source files in the scope</li>
		<li>Required projects: Search in all required projects</li>
		<li>JRE libraries: Search in JRE libraries on the build path</li>
		<li>Application libraries: Search in libraries on the build path</li>
	</ul>

    <h2 class="Item">Scope</h2>

    <p>Select to limit your search results to one of the following scope</p>

    <ul>
      <li>Workspace</li>

      <li>Selected resources</li>
      
      <li>Enclosing Projects</li>

      <li>Working Set</li>
    </ul>

    <p>Press <span class="control">Choose</span> to select or create a working set.</p>


    <h2 class="Item">Search result view, filters</h2>

    <p>The search results are presented in the <b>Search</b> view.</p>
    <p>The <b>View Menu</b> contains these options:</p>
    <ul>
      <li><b>Show As List</b><br>
      Presents results in a flat list. In this mode, the context menu contains a <b>Sort By</b> menu with options
      <b>Name</b>, <b>Path</b>, <b>Parent Name</b>.</li>

      <li><b>Show as Tree</b><br>
      Presents results in a hierarchy. In this mode, 4 buttons appear in the view tool bar,
      where you can <b>Group by Project</b>, <b>Package</b>, <b>File</b>, or <b>Type</b>.
      </li>
      
      <li><b>Filters</b><br>
      Various filters allow to exclude certain search results,
      for example potential matches, matches in imports, Javadocs, deprecated, non-public, static or non-static elements.<br>
      For types, there are filters for inexact or non-matching type arguments.<br>
      For methods, there's a filter for references to overriding methods.<br>
      For fields, there are filters for read or write accesses.<br>
      </li>
    </ul>


    <h3 class="related">Related concepts</h3>
      <a href="../concepts/concept-java-search.htm">Java search</a>
    <h3 class="related">Related references</h3>
      <a href="../reference/ref-menu-search.htm">Search</a>

  </body>
</html>

